<%-- 
    Document   : insert
    Created on : Jun 4, 2011, 1:47:47 PM
    Author     : surya
--%>
<%@page import="com.oreilly.servlet.*"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
                    bean.DataBaseConnection conn = new bean.DataBaseConnection();
                    MultipartRequest mr = new MultipartRequest(request, "\\\\\\\\127.0.0.1\\\\RPL OO\\\\invertebrata\\\\web\\\\picture", 1000000000);
                    String id_spesies = (String) mr.getParameter("gambar");
                    //String id_filum = (String) mr.getParameter("id_filum");
                    //String id_kelas = (String) mr.getParameter("id_kelas");
                    //String id_ordo = (String) mr.getParameter("id_ordo");
                    //String id_familia = (String) mr.getParameter("id_familia");
                    String id_familia = request.getParameter("id_familia");
                    String nama_spesies = (String) mr.getParameter("nama_spesies");
                    String ciri = (String) mr.getParameter("ciri_spesies");
                    String info = (String) mr.getParameter("info_spesies");
                    //System.out.println(path);
                    System.out.println(id_spesies);
                    System.out.println(id_familia);
                    try {         
                        String query = "insert into spesies values('"+id_spesies+ "','"+id_familia+"','"+nama_spesies+"','"+ciri+"','"+info+"','\\\\\\\\127.0.0.1\\\\RPL OO\\\\invertebrata\\\\web\\\\picture\\\\"+request.getParameter("gambar")+"','\\\\\\\\127.0.0.1\\\\RPL OO\\\\invertebrata\\\\web\\\\video')";
                        java.sql.Statement statementI = conn.getConnection().createStatement();
                        statementI.executeUpdate(query);
                        statementI.close();
                    } catch (Exception ex) {
                        System.out.println("message: " + ex.getMessage());
                    }
                    session.setAttribute("upload", "ok");
                    response.sendRedirect("penulis_insert.jsp?id_filum=all&id_class=all&id_ordo=all&id_familia=all&id_spesies=all");
        %>
    </body>
</html>
